﻿#CMAKE_MINIMUM_REQUIRED(VERSION 3.2.3 FATAL_ERROR)

PROJECT(Customplot)

 message(--------------------------------------------------------------------------------------------------------------) 

message( STATUS 项目 = ${PROJECT_NAME})

set(CMAKE_CXX_STANDARD 17)

#qt
SET(CMAKE_PREFIX_PATH $ENV{QT_HOME})
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(CMAKE_AUTOMOC ON)
SET(CMAKE_AUTOUIC ON)
SET(CMAKE_AUTORCC ON)
#FIND_PACKAGE(Qt5 COMPONENTS Core Widgets PrintSupport script REQUIRED)

FILE(GLOB HDR_FILES *.h)
AUX_SOURCE_DIRECTORY(. SRC_FILES)
ADD_LIBRARY(${PROJECT_NAME} STATIC
    ${SRC_FILES}
    ${HDR_FILES})

    #qt  

TARGET_LINK_LIBRARIES(${PROJECT_NAME} Qt5::Widgets Qt5::Gui Qt5::Core Qt5::PrintSupport Qt5::Script)

 
INCLUDE_DIRECTORIES("../QCustomplot")
ADD_DEPENDENCIES(${PROJECT_NAME}   QCustomplot)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}    QCustomplot )

IF(MSVC)
    SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/MP")
    CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/../../other/VSUserTemplate.vcxproj.user" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.vcxproj.user")
    ADD_DEFINITIONS(-D_WIN32_WINNT=0x0600 -D_CRT_SECURE_NO_WARNINGS)
ENDIF(MSVC)


message( STATUS END_OF_${PROJECT_NAME})
message(--------------------------------------------------------------------------------------------------------------) 
